package com.ali.common;

import java.util.UUID;

public class UUIDUtil {
    /**
     * 获取UUID
     */
    public static String getUUID() {
        return getUUID(32);
    }

    /**
     * 获取UUID
     */
    public static String getUUID(int size) {
        UUID uuid = UUID.randomUUID();
        String uuidStr = uuid.toString();
        uuidStr = uuidStr.replace("-", "");
        return uuidStr.substring(32 - size);
    }
}
